<!DOCTYPE html>
<html>
<head>
    <script src="./vue3.4.21.js"></script>
</head>
<style>
    .a {
        color:red;
        display: block;
    }
    .b{
        color:blue;
        display: none;
    }
</style>
<body>
    <div id="app">
        <label @click="" v-for="item in list">
            <input 
                type="radio" 
                name="role" 
                :value="item"
            >
            {{item}}
        </label>


        
        <br>

        {{getCount}}
        <hr>
        {{getCountValue()}}
        
        <button @click="add">增加</button>
        <hr>
        <p v-if="count % 2 == 0">双向绑定</p>
        <input type="text" v-model="count">
    </div>
    <script setup>
        const app = Vue.createApp({
            data(){
                return {
                    count: 0,
                    list:['学生','老师','管理员']
                }
            },
            methods:{
                getCountValue(){
                    return '￥' + this.count + '元' 
                },
                add(){
                    this.count ++;
                    this.list.push("其他")
                }
            },
            computed:{
                getCount(){
                    return '￥' + this.count + '元'
                }
            }
        }).mount("#app");
    </script>
</body>
</html>